package io.renren.modules.app.indexController;

import java.util.Arrays;
import java.util.Map;

import io.renren.modules.app.entity.index.YcWelfareEntity;
import io.renren.modules.app.service.YcWelfareService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2023-12-29 16:41:33
 */
@RestController
@RequestMapping("generator/ycwelfare")
public class YcWelfareController {
    @Autowired
    private YcWelfareService ycWelfareService;

    /**
     * 列表
     */



    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("generator:ycwelfare:info")
    public R info(@PathVariable("id") Integer id){
		YcWelfareEntity ycWelfare = ycWelfareService.getById(id);

        return R.ok().put("ycWelfare", ycWelfare);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("generator:ycwelfare:save")
    public R save(@RequestBody YcWelfareEntity ycWelfare){
		ycWelfareService.save(ycWelfare);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("generator:ycwelfare:update")
    public R update(@RequestBody YcWelfareEntity ycWelfare){
		ycWelfareService.updateById(ycWelfare);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("generator:ycwelfare:delete")
    public R delete(@RequestBody Integer[] ids){
		ycWelfareService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
